#ifndef DSPNASM_GENERATOR_H
#define DSPNASM_GENERATOR_H

#include <string>
#include <vector>
#include <memory>
#include "nasm/operand/operand.h"
#include "nasm/instruction/instruction.h"

namespace dspnasm {
    class Generator {
    public:
        std::shared_ptr<Instruction> gen3Op(const std::string &opName, const std::string &funcUnit,
                                            const std::vector<std::shared_ptr<Operand>> &ops, bool p);

        static std::bitset<5> computeDst(std::shared_ptr<Operand> op);

        static std::bitset<5> computeSrc1(std::shared_ptr<Operand> op);

        static std::bitset<5> computeSrc2(std::shared_ptr<Operand> op);

        static bool computeS(const std::string &funcUnit);

        static bool computeX(std::shared_ptr<Operand> op, bool s);
    };
}


#endif //DSPNASM_GENERATOR_H
